﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Cms/Admin.Master" AutoEventWireup="true"
    CodeBehind="KeywordMan.aspx.cs" Inherits="Aij1.Cms.KeywordMan" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Xpo.v13.1.Web, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Xpo" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1 { width: 100%; }
    </style>
    <script type="text/javascript">
        function btnNew_Click(s, e) {
            grid.AddNewRow();
        }

        function btnDelete_Click(s, e) {
            var selkeys = grid.GetSelectedKeysOnPage().join(',');
            if (selkeys.length > 0 && confirm("确认删除?")) {
                grid.PerformCallback('del:' + selkeys);
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PH" runat="server">
    <table class="style1">
        <tr>
            <td width="120">
                <dx:ASPxButton ID="btnNew" runat="server" Text="新增" AutoPostBack="False">
                    <ClientSideEvents Click="btnNew_Click" />
                </dx:ASPxButton>
            </td>
            <td width="120">
                <dx:ASPxButton ID="btnDelete" runat="server" Text="批量删除" AutoPostBack="False" ClientInstanceName="btnDelete">
                    <ClientSideEvents Click="btnDelete_Click" />
                </dx:ASPxButton>
            </td>
            <td width="120">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <dx:ASPxGridView ID="GV" runat="server" AutoGenerateColumns="False" ClientInstanceName="grid"
        DataSourceID="XpoDataSource1" KeyFieldName="Oid" Width="100%" 
        oncustomcallback="GV_CustomCallback">
        <Columns>
            <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="30px">
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="编号" FieldName="Oid" ReadOnly="True" VisibleIndex="1"
                Width="60px">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="关键词" FieldName="Title" VisibleIndex="2" Width="120px">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="使用次数" FieldName="UseTimes" VisibleIndex="3" Width="40px">
                <Settings AllowHeaderFilter="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="同义词" FieldName="Synonyms" VisibleIndex="4">
                <Settings AllowHeaderFilter="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataCheckColumn Caption="用" FieldName="InUse" VisibleIndex="5" 
                Width="30px">
            </dx:GridViewDataCheckColumn>
            <dx:GridViewCommandColumn Caption="操作" VisibleIndex="6" Width="80px">
                <EditButton Text="编辑" Visible="True">
                </EditButton>
                <DeleteButton Text="删除" Visible="True">
                </DeleteButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dx:GridViewCommandColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="20">
        </SettingsPager>
        <SettingsEditing Mode="Inline" />
        <Settings ShowFilterRow="True" />
    </dx:ASPxGridView>
    <dx:XpoDataSource ID="XpoDataSource1" runat="server" Criteria="ParentId IS NULL"
        TypeName="Aij1.Model.A_Keyword" DefaultSorting="Title">
    </dx:XpoDataSource>
</asp:Content>
